package edu.whu.irlab.entry;

import com.google.common.base.Strings;
import edu.whu.irlab.db.dao.BaseDao;
import edu.whu.irlab.entity.Task;
import org.apache.commons.io.FileUtils;

import java.io.File;
import java.io.IOException;
import java.util.List;

/**
 * Created by zhongwei on 2017/6/2.
 */
public class Tasker {

    static BaseDao baseDao = new BaseDao();

    public static void main(String[] args) throws IOException {
        List<String> list = FileUtils.readLines(new File("tasks.txt"));
        for (String str : list) {
            if (Strings.isNullOrEmpty(str))
                continue;
            Task task = new Task();
            task.setUrl(str);
            task.setDone(0);
            baseDao.create(task);
        }
    }
}
